package com.etc.springbootssm.schedule;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class DemoSchedule {

    // @Scheduled(cron="* * * * * *") //每隔1秒执行一次
     @Scheduled(cron="0/2 * * * * *") //每隔2秒执行一次
    public void helloSchedule(){
        System.out.println("helloSchedule  : "+new Date());
    }
}
